home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / Bonus / VCLZip / kp222_b5.exe / KpLib.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-23  |  5.2 KB  |  143 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1999 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'KpLib.pas' rev: 5.00
  6.  
  7. #ifndef KpLibHPP
  8. #define KpLibHPP
  9.  
  10. #pragma delphiheader begin
  11. #pragma option push -w-
  12. #pragma option push -Vx
  13. #include <kpZcnst.hpp>    // Pascal unit
  14. #include <kpZipObj.hpp>    // Pascal unit
  15. #include <kpMatch.hpp>    // Pascal unit
  16. #include <Classes.hpp>    // Pascal unit
  17. #include <FileCtrl.hpp>    // Pascal unit
  18. #include <SysUtils.hpp>    // Pascal unit
  19. #include <kpSStrm.hpp>    // Pascal unit
  20. #include <Windows.hpp>    // Pascal unit
  21. #include <SysInit.hpp>    // Pascal unit
  22. #include <System.hpp>    // Pascal unit
  23.  
  24. //-- user supplied -----------------------------------------------------------
  25.  
  26. namespace Kplib
  27. {
  28. //-- type declarations -------------------------------------------------------
  29. typedef Byte *BYTEPTR;
  30.  
  31. typedef Sysutils::TSearchRec *PSearchRec;
  32.  
  33. typedef double Comp;
  34.  
  35. class DELPHICLASS TLFNFileStream;
  36. class PASCALIMPLEMENTATION TLFNFileStream : public Kpsstrm::TS_BufferStream 
  37. {
  38.     typedef Kpsstrm::TS_BufferStream inherited;
  39.     
  40. public:
  41.     Classes::TFileStream* theFile;
  42.     int __fastcall GetHandle(void);
  43.     __fastcall TLFNFileStream(const AnsiString FileName, Word Mode, bool FlushOut, int BufSize);
  44.     __fastcall virtual ~TLFNFileStream(void);
  45.     __property int Handle = {read=GetHandle, nodefault};
  46. public:
  47.     #pragma option push -w-inl
  48.     /* TS_BufferStream.Create */ inline __fastcall virtual TLFNFileStream(Classes::TStream* Stream, int 
  49.         BufferSize) : Kpsstrm::TS_BufferStream(Stream, BufferSize) { }
  50.     #pragma option pop
  51.     
  52. };
  53.  
  54.  
  55. #pragma option push -b-
  56. enum TConversionOperation { SHORTEN, LENGTHEN };
  57. #pragma option pop
  58.  
  59. class DELPHICLASS TSearchData;
  60. class PASCALIMPLEMENTATION TSearchData : public System::TObject 
  61. {
  62.     typedef System::TObject inherited;
  63.     
  64. public:
  65.     AnsiString Directory;
  66.     AnsiString Pattern;
  67.     int SearchResult;
  68.     Sysutils::TSearchRec SearchRec;
  69.     bool NoFiles;
  70.     void __fastcall Next(void);
  71.     __fastcall TSearchData(AnsiString Path, AnsiString MatchPattern);
  72.     __fastcall virtual ~TSearchData(void);
  73. };
  74.  
  75.  
  76. class DELPHICLASS TDirSearch;
  77. class PASCALIMPLEMENTATION TDirSearch : public System::TObject 
  78. {
  79.     typedef System::TObject inherited;
  80.     
  81. private:
  82.     TSearchData* FDirStack[21];
  83.     int FCurrentLevel;
  84.     AnsiString FPattern;
  85.     bool FRecurse;
  86.     Classes::TStrings* FWildDirStack;
  87.     int FNumWildDirs;
  88.     int FWildDirID;
  89.     bool __fastcall IsChildDir(const Sysutils::TSearchRec &SR);
  90.     bool __fastcall IsDir(const Sysutils::TSearchRec &SR);
  91.     
  92. public:
  93.     __fastcall TDirSearch(const AnsiString StartingDir, const AnsiString Pattern, bool RecurseDirs);
  94.     __fastcall virtual ~TDirSearch(void);
  95.     AnsiString __fastcall NextFile(Sysutils::TSearchRec &SR);
  96.     __property bool Recurse = {read=FRecurse, write=FRecurse, default=0};
  97. };
  98.  
  99.  
  100. //-- var, const, procedure ---------------------------------------------------
  101. static const char WILDCARD_RECURSE = '\x3e';
  102. static const char WILDCARD_NORECURSE = '\x7c';
  103. extern PACKAGE __int64 __fastcall kpmin(__int64 a, __int64 b);
  104. extern PACKAGE __int64 __fastcall kpmax(__int64 a, __int64 b);
  105. extern PACKAGE int __fastcall CRate(int uc, int c);
  106. extern PACKAGE int __fastcall CBigRate(double uc, double c);
  107. extern PACKAGE char * __fastcall DOSToUnixFilename(char * fn);
  108. extern PACKAGE char * __fastcall UnixToDOSFilename(char * fn);
  109. extern PACKAGE AnsiString __fastcall RightStr(AnsiString str, int count);
  110. extern PACKAGE AnsiString __fastcall LeftStr(AnsiString str, int count);
  111. extern PACKAGE bool __fastcall IsWildCard(AnsiString fname);
  112. extern PACKAGE int __fastcall GoodTimeStamp(int theTimeStamp);
  113. extern PACKAGE System::TDateTime __fastcall FileDate(AnsiString fname);
  114. extern PACKAGE void __fastcall ForceDirs(AnsiString Dir);
  115. extern PACKAGE bool __fastcall File_Exists(const AnsiString FileName);
  116. extern PACKAGE bool __fastcall DirExists(AnsiString Dir);
  117. extern PACKAGE void __fastcall GetDirectory(Byte D, AnsiString &S);
  118. extern PACKAGE void __fastcall ChDirectory(const AnsiString S);
  119. extern PACKAGE bool __fastcall DoRenameCopy(const AnsiString FromFile, const AnsiString ToFile);
  120. extern PACKAGE void __fastcall FileCopy(const AnsiString FromFile, const AnsiString ToFile);
  121. extern PACKAGE AnsiString __fastcall PCharToStr(char * CStr);
  122. extern PACKAGE char * __fastcall StrToPChar(AnsiString Str);
  123. extern PACKAGE BOOL __fastcall SetVolLabel(AnsiString Disk, AnsiString NewLabel);
  124. extern PACKAGE AnsiString __fastcall GetVolumeLabel(AnsiString Disk);
  125. extern PACKAGE AnsiString __fastcall TempFileName(AnsiString Pathname);
  126. extern PACKAGE void __fastcall OemFilter(AnsiString &fname);
  127. extern PACKAGE void __fastcall Assert(bool Value, AnsiString Msg);
  128. extern PACKAGE bool __fastcall BlockCompare(const void *Buf1, const void *Buf2, int Count);
  129. extern PACKAGE char * __fastcall StringAsPChar(AnsiString &S);
  130. extern PACKAGE AnsiString __fastcall LFN_ConvertLFName(AnsiString LName, TConversionOperation ConvertOperation
  131.     );
  132.  
  133. }    /* namespace Kplib */
  134. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  135. using namespace Kplib;
  136. #endif
  137. #pragma option pop    // -w-
  138. #pragma option pop    // -Vx
  139.  
  140. #pragma delphiheader end.
  141. //-- end unit ----------------------------------------------------------------
  142. #endif    // KpLib
  143.